package Thread;
// 不是直接创建线程，而是使用线程池来管理线程的创建和销毁

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class demo4ExecutorService {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.submit(() -> {
            System.out.println("Running from ExecutorService");
        });
        executor.shutdown();
    }
}

